<template>
	<div id="container">
		<el-tree 
		:data="list" 
		:props="defaultProps"
		:show-checkbox="true"
		@node-click="handleNodeClick">
		</el-tree>
	</div>
</template>

<script>
	import { getMenuTreeList } from '@/api/menu'
	export default {
	    data() {
			return {
				list:[],
				defaultProps: {
					children: 'children',
					label: 'menuName'
				}
			}
		},
		mounted() {
			this.handleGetMenuTreeList()
		},
	    methods: {
			handleNodeClick(data) {
				console.log(data);
			},
			//获取菜单树列表
			handleGetMenuTreeList(){
				getMenuTreeList().then(res => {
					this.list = res.data
				})
			},
			

	    }
	  };
</script>

<style>
</style>